package com.example.demo.web;


import com.example.demo.mapper.IaWxTmplMsgMapper;
import com.example.demo.model.IaWxTmplMsg;
import com.example.demo.utils.RedisUtils;
import com.example.demo.utils.SerializeUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.Arrays;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author cx
 * @since 2019-04-22
 */
@Controller
@RequestMapping("/iaWxTmplMsg")
public class IaWxTmplMsgController {

    @Resource
    private IaWxTmplMsgMapper iaWxTmplMsgMapper;

    @ResponseBody
    @RequestMapping(value = "/red")
    public String redis(String type) {
        if(iaWxTmplMsgMapper.updateTemplNum("1120606259014524928",type,2)<1){
            return  "fail";
        }
        return   "success";
    }

    @ResponseBody
    @RequestMapping(value = "/get")
    public String get(String type) {
        return  RedisUtils.get(type).toString();
    }
}
